﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	public partial class Sys_User
	{
		/// <summary>
		/// 部门名称
		/// </summary>
		[NotMapped]
		public string DeptName { get; set; }

		/// <summary>
		/// 用户角色名称
		/// </summary>
		[NotMapped]
		public List<string> RolesName { get; set; }

		/// <summary>
		/// 用户角色ID
		/// </summary>
		[NotMapped]
		[Required(ErrorMessage = "用户身份不能为空")]
		public List<int> RolesID { get; set; }

		[NotMapped]
		public string GenderText
		{
			get
			{
				return Gender > 0 ? ((ST.Buz.Base.Enums.Gender)Gender).ToString() : "";
			}
		}

		[NotMapped]
		public string UserTypeText
		{
			get
			{
				return UserType > 0 ? ((ST.Buz.Base.Enums.UserType)UserType).ToString() : "";
			}
		}

		[NotMapped]
		public string StateText
		{
			get
			{
				return StateNow > 0 ? ((ST.Buz.Base.Enums.UserState)StateNow).ToString() : "";
			}
		}

		[NotMapped]
		public string OrgName { get; set; }
	}
}
